package com.shr.exam.jd;

import java.util.Scanner;
import java.util.Stack;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		StringBuffer sb = new StringBuffer(str) ;
		int sum = 1;
		while(sb.length() != 0){
			sum *= getType(sb);
		}
		System.out.println(sum);
		sc.close();
	}

	private static int getType(StringBuffer sb) {
		sb.deleteCharAt(0);
		int type = 0;
		for(int i = 0;i<sb.length();i++){
			if(sb.charAt(i) == ')'){
				if(isProper(sb.deleteCharAt(i))){
					type++;
				}
				sb.insert(i, ')');
			}
		}
		return type ;
	}

	private static boolean isProper(StringBuffer sb) {
		Stack<Character> stack = new Stack<>();
		for(int i = 0;i<sb.length();i++){
			if(sb.charAt(i) == '(')
				stack.push(sb.charAt(i));
			else if(sb.charAt(i) == ')')
				try{
					stack.pop();
				}catch (Exception e) {
					return false ;
				}
		}
		if(stack.isEmpty())
			return true;
		else return false;
		
	}
}
